
				
<?php if($mode == "ALL"){?>


<section class="wrapper">


	<div class="col-lg-12">
		<!--work progress start-->
		<section class="panel">

			<div class="inbox-head">
				<?php if($parent_id == 0){?>
				<h3>ALL PARENTS</h3>
				<?php }?>
				<?php if($parent_id != 0){?>
				<h3>ALL CHILDS</h3>
				<?php }?>
				<?php if($parent_id == 0){?>
				<a title="Add Parent" href="<?= base_url();?>secure/category/add/<?= $parent_id;?>"><button type="button" class="btn btn-danger pull-right">
					<i class="icon-plus"></i>
				</button></a>
				<?php }?>
				<?php if($parent_id != 0){?>
				<a title="Add Child" href="<?= base_url();?>secure/category/add/<?= $parent_id;?>"><button type="button" class="btn btn-danger pull-right">
					<i class="icon-plus"></i>
				</button></a>
				<?php }?>
				
				
			
			</div>


			<div class="panel-body">
				
				<?php if($category){?>
				<table class="table table-striped table-advance table-hover">
					<thead>
						<tr>
							<th><i class="icon-bullhorn"></i> Category Name</th>
							<th><i class=" icon-bookmark"></i> Status</th>
							<th width="20%"><i class=" icon-edit"></i>Action</th>
						</tr>
					</thead>
					<tbody>
						
						<?php foreach ($category as $category):?>
						<tr>
							<td><a href="<?= base_url();?>secure/category/all/<?= $category->id;?>"><?= $category->name; ?></a></td>
							<?php if($category->status == '51'){?>
							<td><button title="Active" class="btn btn-success btn-xs">
									<i class="icon-ok "></i>
								</button></td>
							<td>
							<?php }?>
							<?php if($category->status == '1'){?>
							<td><button title="Inactive" class="btn btn-danger btn-xs">
									<i class="icon-remove "></i>
								</button></td>
							<td>
							<?php }?>
							
								<a title="Edit" href="<?= base_url();?>secure/category/edit/<?= $category->id;?>"><button class="btn btn-primary btn-xs">
								<i class="icon-pencil"></i>
								</button></a>
								<a title="Delete" href="<?= base_url();?>secure/category/delete/<?= $category->id;?>" class="btn btn-danger btn-xs" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  >
									<i class="icon-trash "></i>
								</a>
								
								
								<?php if(!$category->parent_id == 0){?>
								<a title="Back to Parent"href="<?= base_url();?>secure/category/all/0"><button class="btn btn-success btn-xs">
								<i class="icon-arrow-left"></i>
								</button></a>
								<?php }?>
								
								
								
								<a title="View Child" href="<?= base_url();?>secure/category/all/<?= $category->id;?>"><button class="btn btn-success btn-xs">
								<i class="icon-arrow-right"></i>
								</button></a>
								
							</td>
						</tr>
						<?php endforeach;?>
						
					</tbody>
					
				</table>
				<?php }else{?>
				<div class='alert alert-danger'>
  Opps! No Data found....
</div>
				<?php }?>
			</div>

		</section>
		<!--work progress end-->
	</div>

</section>





<?php }?>

<?php if($mode == "CATEGORY"){?>
<section class="wrapper">
	<div class="col-lg-12">
		<!--work progress start-->
		<section class="panel">

			<div class="inbox-head">
			<?php if($parent_id == 0){?>
				<h3>
					PARENT ADD 
					
				</h3>
				
				<a title="All Parents" href="<?= base_url();?>secure/category/all/<?= $parent_id;?>"><button type="button"
						class="btn btn-warning pull-right">
						<i class="icon-list"></i>
					</button> </a>
				<?php }?>
				<?php if($parent_id != 0){?>
				<h3>
					CHILD ADD 
					
				</h3>
				<a title="All Childs" href="<?= base_url();?>secure/category/all/<?= $parent_id;?>"><button type="button"
						class="btn btn-warning pull-right">
						<i class="icon-list"></i>
					</button> </a>
					<?php }?>
			</div>


			<div class="panel-body">
				<?php
				if($this->session->flashdata('message'))
				{
					$msg = $this->session->flashdata('message');
					echo '<div class="alert alert-info">' . $this->session->flashdata('message') . '</div>';
				}
				?>



				<form class="form-horizontal" name="frmlocation" method="POST"
					action="<?= base_url();?>secure/category/insert">

	<input type="hidden"
					name="<?php echo $this->security->get_csrf_token_name(); ?>"
					value="<?php echo $this->security->get_csrf_hash();?>" />
					
					<div class="border-head">
						<h3>General Information</h3>
					</div>
				<div class="form-group">
						<label class="col-lg-2 control-label">
							Category Name</label>

						<div class="col-lg-6">
							<span class="text text-danger"> <?php echo form_error('category'); ?>
							</span> 
							
							<input type="hidden" class="form-control" id="category_id"
								name="category_id" value="<?= $parent_id;?>"
								>
							<input type="text" class="form-control" id="category"
								name="category" placeholder="Type a Category Name" value="<?php echo form_error();?>"
								>

						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-2 control-label">
							Description</label>
						<div class="col-lg-10">
<textarea class="form-control" rows="5" id="description"name="description"></textarea>
						</div>
					</div>
					<div class="border-head">
						<h3>SEO Settings</h3>
					</div>

					<div class="form-group">
						<label class="col-lg-2 control-label">SEO Url</label>
						<div class="col-lg-6">
						<span class="text text-danger"> <?php echo form_error('seourl'); ?>
							</span> 
						
							<input type="text" class="form-control" id="seourl" name="seourl"
								placeholder="SEO Url" value="<?php echo form_error();?>">
						</div>
					</div>

					<div class="form-group">
						<label class="col-lg-2 control-label">Meta
							Title</label>
						<div class="col-lg-10">
							<input type="text" class="form-control"
								placeholder="Meta Title" name="meta_title" id="meta_title"
								>
						</div>
					</div>

					<div class="form-group">
						<label class="col-lg-2 control-label">Meta
							Keyword</label>
						<div class="col-lg-10">
							<input type="text" class="form-control"
								placeholder="Keyword (comma separated)" name="meta_keyword"
								id="meta_keyword" >
						</div>
					</div>

					<div class="form-group">
						<label class="col-lg-2 control-label">Meta
							Description</label>
						<div class="col-lg-10">
							<textarea class="form-control" rows="3" name="meta_description">
								
							</textarea>
						</div>
					</div>

					<div class="form-group">
						<div class="col-lg-offset-2 col-lg-10">
							<input type="submit" class="pull-right btn btn-success"
								value="Save
								&amp Continue.." <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  >
						</div>
					</div>
				</form>
			</div>

		</section>
		<!--work progress end-->
	</div>

</section>
<?php }?>


<?php if($mode == "EDIT"){?>
<section class="wrapper">
	<div class="col-lg-12">
		<!--work progress start-->
		<section class="panel">

			<div class="inbox-head">
			<?php if($cat_id == 0){?>
				<h3>
					PARENT EDIT : <?= $category['info']->name;?> 
					
				</h3>
				<a title="Back to All Parents" href="<?= base_url();?>secure/category/all/<?= $category['info']->parent_id;?>"><button type="button"
						class="btn btn-warning pull-right">
						<i class="icon-list"></i>
					</button> </a>
				<?php }?>
				
				<?php if($cat_id != 0){?>
				<h3>
					CHILD EDIT : <?= $category['info']->name;?> 
					
				</h3>
				<a title="Back to All Childs" href="<?= base_url();?>secure/category/all/<?= $category['info']->parent_id;?>"><button type="button"
						class="btn btn-warning pull-right">
						<i class="icon-list"></i>
					</button> </a>
				<?php }?>	
					
			</div>


			<div class="panel-body">
				<?php
				if($this->session->flashdata('message'))
				{
					$msg = $this->session->flashdata('message');
					echo '<div class="alert alert-info">' . $this->session->flashdata('message') . '</div>';
				}
				?>



				<form class="form-horizontal" name="frmlocation" method="POST"
					action="<?= base_url();?>secure/category/update">
<input type="hidden"
					name="<?php echo $this->security->get_csrf_token_name(); ?>"
					value="<?php echo $this->security->get_csrf_hash();?>" />

					<div class="border-head">
						<h3>General Information</h3>
					</div>
					<div class="form-group">
						<label class="col-lg-2 control-label">
							Category Name</label>

						<div class="col-lg-6">
							<span class="text text-danger"> <?php echo form_error('location'); ?>
							</span> 
							
							<input type="hidden" class="form-control" id="id"
								name="id" value="<?= $category['info']->id;?>"
								>
							<input type="text" class="form-control" id="category"
								name="category" placeholder="Type a Category Name" value="<?= $category['info']->name;?>"
								>

						</div>
					</div>
			<div class="form-group">
						<label class="col-lg-2 control-label">
							Description</label>
						<div class="col-lg-10">
<textarea class="form-control" rows="5" id="description"name="description"><?= $category['info']->description;?></textarea>
						</div>
					</div>
					<div class="border-head">
						<h3>SEO Settings</h3>
					</div>

					<div class="form-group">
						<label class="col-lg-2 control-label">SEO Url</label>
						<div class="col-lg-6">
						<span class="text text-danger"> <?php echo form_error('seourl'); ?>
							</span> 
						
							<input type="text" class="form-control" id="seourl" name="seourl"
								placeholder="SEO Url" value="<?= $category['info']->slug;?>" >
						</div>
					</div>

					<div class="form-group">
						<label class="col-lg-2 control-label">Meta
							Title</label>
						<div class="col-lg-10">
							<input type="text" class="form-control"
								placeholder="Meta Title" name="meta_title" id="meta_title"
								value="<?= $category['info']->meta_title;?>" >
						</div>
					</div>

					<div class="form-group">
						<label class="col-lg-2 control-label">Meta
							Keyword</label>
						<div class="col-lg-10">
							<input type="text" class="form-control"
								placeholder="Keyword (comma separated)" name="meta_keyword"
								id="meta_keyword" value="<?= $category['info']->meta_title;?>">
						</div>
					</div>

					<div class="form-group">
						<label class="col-lg-2 control-label">Meta
							Description</label>
						<div class="col-lg-10">
<textarea class="form-control" rows="3" name="meta_description"><?= $category['info']->meta_description;?></textarea>
						</div>
					</div>

					<div class="form-group">
						<div class="col-lg-offset-2 col-lg-10">
							<input type="submit"
								class="pull-right btn btn-success"
								value="Update
								&amp Continue.." <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  >
						</div>
					</div>
				</form>
			</div>

		</section>
		<!--work progress end-->
	</div>

</section>
<?php }?>

				
				
				
				